# alien_0 = {'color': 'green', 'points': 5}

# print(alien_0['color'])
# print(alien_0['points'])

# new_points = alien_0['points']
# print(f"You just earned {new_points} points!")

# alien_0['x_position'] = 0
# alien_0['y_position'] = 25
# print(alien_0)

######################创建一个空字典#######################

# alien_0 = {}

# alien_0['color'] = 'green'
# alien_0['points'] = 5

# print(alien_0)

######################修改字典中的值#######################

# alien_0 = {'color': 'green'}
# print(alien_0['color'])

# alien_0['color'] = 'yellow'
# print(alien_0['color'])


# alien_0 = {'x_position': 0, 'y_position': 25, 'speed': 'medium'}
# print(f"Original position: {alien_0['x_position']}")

# # 向右移动外星人
# # 根据当前速度确定将外星人向右移动多远
# if alien_0['speed'] == 'slow':
#     x_increment = 1
# elif alien_0['speed'] == 'medium':
#     x_increment = 2
# else:
#     x_increment = 3

# alien_0['x_position'] += x_increment

# print(f"New position: {alien_0['x_position']}")

######################删除键值对#######################

alien_0 = {'color': 'green', 'points': 5}
print(alien_0)

del alien_0['points']
print(alien_0)